package Twice.day09.strings;

/**
 * @Author: lya
 * @Description: 本类的作用描述:
 * @CreateDate: 2019/8/12
 * @Version: 1.0
 */
public class BinaryDemo {
    public static void main(String[] args) {
        int a = 10;

        StringBuilder str = new StringBuilder();

        while(true){
            int s = a/2;
            int y = a%2;
            str.append(y);
            if(s == 0){
                break;
            }
            a = s;
        }
        System.out.println(str.reverse());
    }
}
